<?php

defined( '_JEXEC' ) or die( 'Restricted access' );

jimport( 'joomla.application.component.view');

class SEventViewEvents extends JView
{
	function display($tpl=NULL)
	{
		// Get data from the model
		$pagination = $this->get('Pagination');
		
		$event_types     = $this->get('EventTypes') ;
		$events     = $this->get('Events') ;
		
		$user = &JFactory::getUser();
		if ($user->guest) {
			$userId = -1 ;
		} else {
			$userId = $user->id ;
		}
		
		$this->assignRef( 'event_types', $event_types);
		$this->assignRef( 'events', $events);
		$this->assignRef( 'userId', $userId);
		
		//is it realy needed?
		$this->assignRef( 'pagination', $pagination);
		
		parent::display($tpl);
	}
}
